
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="utf-8"></meta>
      <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
      <title>Chapter&nbsp;3.&nbsp;Installation in Neo4j Server &amp; Docker - APOC User Guide 3.5</title>
      <link rel="stylesheet" type="text/css" href="../docbook.css"></link>
      <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,600,300italic"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/theme/neo.min.css"></link>
      <link rel="stylesheet" type="text/css" href="../css/chunked-base.css"></link>
      <link rel="stylesheet" type="text/css" href="../css/extra.css"></link><script src="//code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script><script src="//cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js" type="text/javascript"></script><script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/addon/runmode/runmode.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/mode/cypher/cypher.min.js" type="text/javascript"></script><script src="../javascript/datatable.js" type="text/javascript"></script><script src="../javascript/colorize.js" type="text/javascript"></script><script src="../javascript/tabs-for-chunked.js" type="text/javascript"></script><script src="../javascript/mp-nav.js" type="text/javascript"></script><script src="../javascript/versionswitcher.js" type="text/javascript"></script><script src="../javascript/version.js" type="text/javascript"></script><script src="//s3-eu-west-1.amazonaws.com/alpha.neohq.net/docs/new-manual/assets/search.js" type="text/javascript"></script><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></meta>
      <link rel="prev" href="../help/" title="Chapter&nbsp;2.&nbsp;Built in Help"></link>
      <link rel="next" href="../config/" title="Chapter&nbsp;5.&nbsp;Configuration Options"></link>
      <link rel="shortcut icon" href="https://neo4j.com/wp-content/themes/neo4jweb/favicon.ico"></link><script>
        $(document).ready(function() {
          CodeMirror.colorize();
          tabTheSource($('body'));
          var $header = $('header').first();
          $header.prepend(
            $('<a href="" id="logo"><img src="https://neo4j.com/wp-content/themes/neo4jweb/assets/images/neo4j-logo-2015.png" alt="Neo4j Logo"></img></a>')
          );
          var $sidebar = $('<div id="sidebar-wrapper"></div>');
          $.get('toc.html', function (d){
            $(d).appendTo($sidebar);
            highlightToc();
            highlightLibraryHeader();
          });
          $sidebar.insertAfter($('header').first());
        });
        </script></head>
   <body>
      <header>
         <div class="searchbox">
            <form id="search-form" class="search" name="search-form" role="search"><input id="search-form-input" name="q" title="search" type="search" lang="en" placeholder="Search Neo4j docs..." aria-label="Search Neo4j documentation" max-length="128" required="required"></input><input id="search-form-button" type="submit" value="Search"></input></form>
         </div>
         <ul class="documentation-library">
            <li><a href="https://neo4j.com/docs/operations-manual/current">Operations Manual</a></li>
            <li><a href="https://neo4j.com/docs/developer-manual/current/">Developer Manual</a></li>
            <li><a href="https://neo4j.com/docs/ogm-manual/current/">OGM Manual</a></li>
            <li><a href="https://neo4j.com/docs/graph-algorithms/current/">Graph Algorithms</a></li>
            <li><a href="https://neo4j-contrib.github.io/neo4j-apoc-procedures/3.5/">APOC</a></li>
            <li><a href="https://neo4j.com/docs/java-reference/current/">Java Reference</a></li>
         </ul>
         <nav id="header-nav"><span class="nav-previous"><a accesskey="p" href="../help/"><span class="fa fa-long-arrow-left" aria-hidden="true"></span>Built in Help</a></span><span class="nav-current">
               <p class="nav-title hidden">Chapter&nbsp;3.&nbsp;Installation in Neo4j Server &amp; Docker</p></span><span class="nav-next"><a accesskey="n" href="../config/">Configuration Options<span class="fa fa-long-arrow-right" aria-hidden="true"></span></a></span></nav>
      </header>
      <div id="search-results" class="hidden"></div>
      <section class="chapter" id="installation">
         <div class="titlepage">
            <div>
               <div>
                  <h1 class="title">Chapter&nbsp;3.&nbsp;Installation in Neo4j Server &amp; Docker</h1>
               </div>
            </div>
         </div>
         <section class="section" id="_manual_installation_download_latest_release">
            <div class="titlepage">
               <div>
                  <div>
                     <h2 class="title" style="clear: both"><a class="anchor" href="#_manual_installation_download_latest_release"></a>3.1.&nbsp;Manual Installation: Download latest release
                     </h2>
                  </div>
               </div>
            </div>
            <p>Since APOC relies in some places on Neo4j&#8217;s internal APIs you need to use the <span class="strong"><strong>matching APOC version</strong></span> for your Neo4j installaton.
               Make sure that the <span class="strong"><strong>first two version numbers match between Neo4j and APOC</strong></span>.
            </p>
            <p>Go to to <a class="link" href="http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.5" target="_top">the latest release</a> for <span class="strong"><strong>Neo4j version 3.4</strong></span>
                and download the binary jar to place into your <code class="literal">$NEO4J_HOME/plugins</code> folder.
            </p>
            <p>You can find <a class="link" href="http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/" target="_top">all releases here</a>.
            </p>
            <div class="admonitionblock warning">
               <table>
                  <tbody>
                     <tr>
                        <td class="icon"><i class="fa icon-warning" title="warning"></i></td>
                        <td class="content">
                           <p>Procedures that use internal APIs have to be allowed in <code class="literal">$NEO4J_HOME/conf/neo4j.conf</code> with, e.g. <code class="literal">dbms.security.procedures.unrestricted=apoc.*</code> for security reasons.
                           </p>
                           <p>If you want to use this via docker, you need to amend <code class="literal">-e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*</code> to your <code class="literal">docker run &#8230;&#8203;</code> command.
                              The three backslashes are necessary to prevent wildcard expansions.
                           </p>
                           <p>You <span class="emphasis"><em>can</em></span> also whitelist procedures and functions in general to be loaded using: <code class="literal">dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*</code></p>
                        </td>
                     </tr>
                  </tbody>
               </table>
            </div>
         </section>
         <section class="section" id="_using_apoc_with_the_neo4j_docker_image">
            <div class="titlepage">
               <div>
                  <div>
                     <h2 class="title" style="clear: both"><a class="anchor" href="#_using_apoc_with_the_neo4j_docker_image"></a>3.2.&nbsp;Using APOC with the Neo4j Docker image
                     </h2>
                  </div>
               </div>
            </div>
            <p>The <a class="link" href="https://hub.docker.com/_/neo4j/" target="_top">Neo4j Docker image</a> allows to supply a volume for the <code class="literal">/plugins</code> folder.
               Download the APOC release matching your Neo4j version to local folder <code class="literal">plugins</code> and provide it as a data volume:
            </p><pre class="programlisting highlight"><code data-lang="bash">mkdir plugins
pushd plugins
wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5/apoc-3.5-all.jar
popd
docker run --rm -e NEO4J_AUTH=none -p 7474:7474 -v $PWD/plugins:/plugins -p 7687:7687 neo4j:3.4</code></pre><p>If you want to pass custom apoc config to your Docker instance, you can use environment variables, like here:</p><pre class="screen highlight"><code>docker run \
    -p 7474:7474 -p 7687:7687 \
    -v $PWD/data:/data -v $PWD/plugins:/plugins \
    --name neo4j-apoc \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    neo4j</code></pre><div class="informalexample">
               <p>If you want to allow APOC&#8217;s procedures that use internal APIs, you need to amend <code class="literal">-e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*</code> to your <code class="literal">docker run &#8230;&#8203;</code> command.
                  The three backslashes are necessary to prevent wildcard expansions.
               </p>
            </div>
         </section>
      </section>
      <footer><script type="text/javascript">
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
          //Allow Linker
          ga('create', 'UA-1192232-34','auto', {'allowLinker': true});
          ga('send', 'pageview');
          // Load the plugin.
          ga('require', 'linker');
          // Define which domains to autoLink.
          ga('linker:autoLink', ['neo4j.org','neo4j.com','neotechnology.com','graphdatabases.com','graphconnect.com']);
        </script><script type="text/javascript">
          document.write(unescape("%3Cscript src='//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
        </script><script>Munchkin.init('773-GON-065');</script></footer>
   </body>
</html>